package com.amigo.online.provider.video.config;
/*package com.amigo.online.provider.video;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import com.amigo.online.provider.video.interceptor.TokenInterceptor;
import com.amigo.online.provider.video.interceptor.TokenInterceptor2;


@Configuration
public class AmigoOnlineProviderVideoAuthConfiguration extends WebMvcConfigurationSupport {
	
	@Bean
	public TokenInterceptor getTokenInterceptor() {
		return new TokenInterceptor();
	}
	@Bean
	public TokenInterceptor2 getTokenInterceptor2() {
		return new TokenInterceptor2();
	}

	@Override
	protected void addInterceptors(InterceptorRegistry registry) {
		List<String> patterns = new ArrayList<>();
		patterns.add("/video/user/videos/**");	//用户上传的视频
		patterns.add("/video/recommended/**");	//推荐视频
		patterns.add("/video/user/uped/list/**");	//用戶喜欢(点赞)的视频列表
		patterns.add("/video/concern");		//关注者的视频
		patterns.add("/video/near/**");		//附近的视频
		patterns.add("/user/getAll/**");
		
		InterceptorRegistration ir = registry.addInterceptor(getTokenInterceptor());
		ir.addPathPatterns("/**");
		//ir.excludePathPatterns(patterns);
		
		InterceptorRegistration ir2 = registry.addInterceptor(getTokenInterceptor2());
		ir2.addPathPatterns(patterns);
	}
	
}
*/